package com.task.submitter.tasks;

public class VoltageFluxData {

	double[][] rGrid;        /// siatka na ktorej wykonujemy obliczenia
	double[][] rGridTemp;    /// pomocnicza siatka
	int rDimension;          /// rozmiar siatki
	double rInitTemp;        /// wartosc domyslna temperatury
	long   rProcessingTime;  /// czas procesowania funkcji Process
	int    rVerboseLevel;    /// ustawia poziom gadatliwosci programu 
	
	public VoltageFluxData(int dim, double temperature){
		initArrays(dim);
		initTempDistribution(temperature);
	}
	
	private void initArrays(int dim){
		rDimension = dim;
	    rGrid     = new double[rDimension][];
	    rGridTemp = new double[rDimension][];
	    for (int i = 0; i < rDimension; i++) {
	      rGrid[i]     = new double[rDimension];
	      rGridTemp[i] = new double[rDimension];
	    }
	}
	
	public void initTempDistribution(double temperature){
	    
	    if ( rDimension > 0){
	      rInitTemp = temperature;
	      rGrid[rDimension/2][rDimension/2] = rInitTemp;
	      rGrid[(rDimension-1)/2][(rDimension-1)/2] = rInitTemp;
	      rGrid[(rDimension-1)/2][rDimension/2] = rInitTemp;    
	      rGrid[rDimension/2][(rDimension-1)/2] = rInitTemp;
	    }
	  }
	
	public void print(){
		for (int row = 0; row < rDimension; row++) {
		      for (int col = 0; col < rDimension; col++) {
		        System.out.print( rGrid[row][col] + " " );
		      }    
		      System.out.println( " " );
	    }
	}
	
	public double[][] getrGrid() {
		return rGrid;
	}
	public void setrGrid(double[][] rGrid) {
		this.rGrid = rGrid;
	}
	public double[][] getrGridTemp() {
		return rGridTemp;
	}
	public void setrGridTemp(double[][] rGridTemp) {
		this.rGridTemp = rGridTemp;
	}
	public int getrDimension() {
		return rDimension;
	}
	public void setrDimension(int rDimension) {
		this.rDimension = rDimension;
	}
	public double getrInitTemp() {
		return rInitTemp;
	}
	public void setrInitTemp(double rInitTemp) {
		this.rInitTemp = rInitTemp;
	}
	public long getrProcessingTime() {
		return rProcessingTime;
	}
	public void setrProcessingTime(long rProcessingTime) {
		this.rProcessingTime = rProcessingTime;
	}
	public int getrVerboseLevel() {
		return rVerboseLevel;
	}
	public void setrVerboseLevel(int rVerboseLevel) {
		this.rVerboseLevel = rVerboseLevel;
	}
	
}
